Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Historic Data, Showing In Simple Table #94

Merged
merged 14 commits into from
May 8, 2024
Merged

Conversation

vkoves
Copy link
Owner

@vkoves vkoves commented May 1, 2024

Description

Updated the data process to generate a new benchmarking-all-years.csv, which contains a smaller set of columns with historic data, so we can see emissions and energy use change over time, and adds a simple table view to render this data. This isn't elegant, but is better than not having the data at all.

Demo From Merchandise Mart:

Screenshot from 2024-05-07 22-05-43

Note: Only columns with any values will be rendered, to reduce noise. So for Merchandise Mart, the Energy Star Score or District Heating is not shown over time.

Resolves #73

Testing Instructions

Confirmed that historical data renders properly on a variety of pages - even if a building only has one year of data, the table should render fine. Also made sure the table works well on mobile by scrolling it horizontally.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@vkoves vkoves added enhancement New feature or request data Data updates & tweaks labels May 1, 2024
Copy link

netlify bot commented May 1, 2024

Deploy Preview for radiant-cucurucho-d09bae ready!

Name Link
🔨 Latest commit ee31e35
🔍 Latest deploy log https://app.netlify.com/sites/radiant-cucurucho-d09bae/deploys/663aeba1f14a880008095b8b
😎 Deploy Preview https://deploy-preview-94--radiant-cucurucho-d09bae.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vkoves
Copy link
Owner Author

vkoves commented May 8, 2024

Idea for improvement: Hide columns that never have data (e.g. the Energy Star Score in the PR description screenshot from Merch Mart) since there's no point comparing something with no data at all.

Copy link
Collaborator

@alexkcode alexkcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't do a full run through (e.g. all the tests and checking frontend outputs), but can re-review if that becomes an issue. Otherwise the script changes look pretty straightforward.

Copy link
Collaborator

@pldorn pldorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python code lgtm 👍

I think you can commit once you get the merge conflict resolved

// A column is empty if it's all empty string or '0', so skip it if so. Some columns switch
// between both, like Natural Gas Use on Merch Mart, which we also want to ignore
return !this.historicBenchmarks.every((datum) => {
return (datum as any)[colKey] === '' || (datum as any)[colKey] === '0.0';

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
// A column is empty if it's all empty string or '0', so skip it if so. Some columns switch
// between both, like Natural Gas Use on Merch Mart, which we also want to ignore
return !this.historicBenchmarks.every((datum) => {
return (datum as any)[colKey] === '' || (datum as any)[colKey] === '0.0';

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
Copy link
Collaborator

@pldorn pldorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved (again)

@vkoves vkoves merged commit 9b53c30 into main May 8, 2024
7 checks passed
@vkoves vkoves deleted the generate-historic-data branch May 8, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Data updates & tweaks enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Full Data Source (Historic Data)
3 participants